﻿
namespace LS.Nc6.Application.Cms
{
    /// <summary>
    /// 提交样式表
    /// </summary>
    public class CmsTablestyleService : BaseService<CmsTablestyleEntity>, ICmsTablestyleService, ITransient
    {
        public async Task<bool> ExistsName(long id, long relatedIdentity, string attributeName)
        {
            return await DbContext.Instance.Queryable<CmsTablestyleEntity>().WhereIF(id > 0, a => a.Id != id).WhereIF(relatedIdentity>0,a=>a.RelatedIdentity ==relatedIdentity).WhereIF(!string.IsNullOrEmpty(attributeName), a => a.AttributeName == attributeName)
               .CountAsync() > 0;
        }
    }
}
